<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Thymeleaf in action</title>
</head>
<body>
<div>
    <form th:action="@{/login}" method="post">
        <h2>请登录</h2>
        <div>
            <label for="username">帐号</label>
            <input type="text" id="username" name="username"/>
        </div>
        <div>
            <label for="password">密码</label>
            <input type="password" id="password" name="password"/>
        </div>
        <div>
            <button type="submit">登录</button>
        </div>
        <div th:if="${loginError}">
            <p th:text="${errorMsg}"></p>
        </div>
    </form>
</div>
</body>
</html>